﻿
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Builder;

namespace WMS.FC.Infrastructure.Register
{
    public static class AutoFacRegister
    {
        public static void RegisterAutoFac(this WebApplicationBuilder builder)
        {
            builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
            builder.Host.ConfigureContainer<ContainerBuilder>((host, builder) =>
            {
                builder.RegisterModule(new AutoFacModuleRegister());
            });
        }
    }
}
